package org.chupito.service.impl;

import java.util.List;

import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.validation.constraints.NotNull;

import org.chupito.dao.impl.StokeItemDAO;
import org.chupito.data.StokeItem;
import org.chupito.search.SearchObject;
import org.chupito.service.StokeItemService;

@Local
@Stateless
public class StokeItemServiceImpl implements StokeItemService{
	
	@Inject
	private StokeItemDAO dao;

	public StokeItemServiceImpl() {
	}

	// @TransactionAttribute(TransactionAttributeType.REQUIRED)
	public void save(@NotNull StokeItem invoice) {
		if (invoice.getId() != null)
			dao.save(invoice);
		else
			dao.create(invoice);
	}
	
	@Override
	public List<StokeItem> find(SearchObject so) {
		// TODO Auto-generated method stub
		return null;
	}
}
